<template>
  <div>
    <div class="zf" :style="$parent.$parent.$parent.collapsed==false?'left: 10%':'left:79px'">
      <a-breadcrumb>
        <a-breadcrumb-item>
          
          <router-link to="/">
            <a-icon type="home" />首页
          </router-link>
        </a-breadcrumb-item>

        <a-breadcrumb-item class="style">
           <router-link :to="parent_path"> {{$route.name}}</router-link>
        </a-breadcrumb-item>
      
      </a-breadcrumb>

      <div class="my">
          <a
            style="margin-right:20px; color:#1890ff"
            href="https://www.bearing.cn"
            target="__blank"
          >轴承网</a>
           <a
            style="margin-right:20px; color:#1890ff"
            href="https://xh.bearing.cn"
            target="__blank"
          >我要找货</a>
        <span class="dwmc">
          <a-icon type="user" />

          {{dwmc!=''&&dwmc!=null?dwmc:''}}
          {{lxr!=''&&lxr!=null?lxr:''}}
          {{bdwxnc!=''&&bdwxnc!=null?bdwxnc:''}}
        </span>
        <span>
          <a-icon type="phone" />
          ：{{phone}}
        </span>
        <a-button type="primary" style="margin-right:10px;" @click="rushcacho">清除缓存</a-button>
        <a-button type="danger" @click="modifyPass">修改密码</a-button>
        <a-button type="primary" @click="loginOut">安全退出</a-button>
      </div>
    </div>
    <!-- 修改密码 -->
    <div class="gl_tjwz" v-if="xgmm">
      <xgmm class=""></xgmm>
      <!-- gl_tjym -->
    </div>
  </div>
</template>

<script>
import xgmm from "../cdsz/xgmm.vue";
import qs from "qs";
export default {
  data() {
    return {
      close: true,
      title: "",
      xgmm: false,
      dwmc: sessionStorage.getItem("dwmc"),
      bdwxnc: sessionStorage.getItem("bdwxnc"),
      lxr: sessionStorage.getItem("lxr"),
      phone: this.$store.state.bbl_phone,
      dwmcname: "",
      path:'',
      parent_path:''
    };
  },

  methods: {
    //展开关闭侧边栏导航
    zhankai() {
      this.close = true;
    },
    modifyPass() {
      this.xgmm = true;
    },
    guanbi() {
      this.close = false;
    },
    //安全退出
    loginOut() {
      sessionStorage.clear();
      location.href = "../login";
    },

    rushcacho() {
      this.axios
        .post(
          "set/deleteCache.php",
          qs.stringify({
            sqdwid: this.$store.state.bbl_sqdwid
          })
        )
        .then(res => {
          if (res.data.code == 303) {
          
            this.$notification["success"]({
              message: "成功",
              description: res.data.msg
            });
          } 
        });
    }

  },
  components: {
    xgmm
  },
  created() {
    this.title = this.$route.query.title;
    var name=this.$route.name.split('/')
    if(name[0]=="商贸通 "){
      console.log("okkkkkkkkk")
        this.parent_path='/smt'
    }else{
      console.log("nooooooooo")
        this.parent_path=this.$route.path


    }
    console.log(name)
    console.log(this.parent_path)

    // this.path = this.$route.query.path;
    
  }
};
</script>

<style lang='less'>
.zf {
  position: fixed;
  top: 0;
  z-index: 80;
  width: 100%;
  height: 50px;
  text-align: left;
  box-shadow: 0px 0px 5px #999;
  line-height: 50px;
  background-color: #fff;
  z-index: 99;
  .my {
    position: absolute;
    top: 0;
    right: 234px;
    .dwmc {
      margin-right: 20px;
    }
  }
  .ant-breadcrumb {
    margin-left: 20px;
    line-height: 52px;
  }
  .ant-btn-danger {
    margin-right: 10px;
  }
  .style {
    color: #666 !important;
    font-size: 14px;
  }
}
</style>
